<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html">

    <h:body>
        <ui:composition template="templates/mainPageLayout.xhtml">
            <ui:define name="activebody">
                <f:view >
                    <h:form>
                        <h:outputText value="Name  :" style="color:black;margin:20px;zoom: 2" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <p:inputText id="name" required="true" label="name" size="40" style="margin:40px"
                                     validatorMessage="Name is Required"
                                     value="#{contactbean.name}">
                        </p:inputText>
                        <p:watermark for="name" value="Name *" />
                        <p:message for="name" />
                        <br></br>
                        <h:outputText value="Email  :"  style="color:black;margin:20px;zoom: 2"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <p:inputText id="email" required="true" label="email" style="margin:40px" size="40"
                                     requiredMessage="Please enter your email address."
                                     validatorMessage="Invalid email format"
                                     value="#{contactbean.mail}">
                            <f:validateRegex 
                                pattern="^[_A-Za-z0-9-\+]+(\.[_A-Za-z0-9-]+)*@[A-Za-z0-9-]+(\.[A-Za-z0-9]+)*(\.[A-Za-z]{2,})$" />
                        </p:inputText>
                        <p:watermark for="email" value="Email Address *" />
                        <p:message for="email" />
                        <br></br>
                        <h:outputText value="Title  :" style="color:black;margin:20px;zoom: 2"/>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <p:inputText id="title" required="true" style="margin:40px" label="title" size="40"
                                     requiredMessage="Please enter your title of message."
                                     validatorMessage="Title is Required"
                                     value="#{contactbean.address}">
                        </p:inputText>
                        <p:watermark for="title" value="Title *" />
                        <p:message for="title" />
                        <br></br>
                        <h:outputText value="Message  :" style="color:black;margin:20px;zoom: 2"/>
                        <br></br>
                        <h:inputTextarea  style="color:black;margin:40px" rows="5" cols="50" id="message" required="true" label="message"
                                     requiredMessage="Please enter your message."
                                     validatorMessage="Message is Required"
                                     value="#{contactbean.message}">
                        </h:inputTextarea>
                        <p:watermark for="message" value="Message *" />
                        <p:message for="message" />
                        <br></br>
                        <p:commandButton value="Send" style="margin:20px"
                                         action="#{userBean.register}" ajax="false" />
                    </h:form>
                </f:view>
            </ui:define>
        </ui:composition>
    </h:body>
</html>
